<?php /*a:1:{s:52:"D:\www\zhibo\application\index\view\index\login.html";i:1538208502;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>用户登录</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" href="/public/static/css/base.css">
	<link rel="stylesheet" href="/public/static/css/iconfont.css">
	<link rel="stylesheet" href="/public/static/css/reg.css">
</head>
<body>
<div id="ajax-hook"></div>
<div class="wrap">
	<div class="wpn">
		<div class="form-data find_password">
			<h4>用户登录</h4>
			<p class="right_now">没有账号？<a href="<?php echo url('index/reg'); ?>">立即注册</a></p>
			<p class="p-input pos">
				<label>账号</label>
				<input type="text" name="userLoginName" id="loginName">
			</p>
			<p class="p-input pos">
				<label>密码</label>
				<input type="password" name="userPassword" id="password">
			</p>

			<button class="lang-btn next" id="login">登录</button>
			<p class="right">Powered by © 2018</p>
		</div>
	</div>
</div>
<form method="post" action="http://rykj.gensee.com/training/site/login" id="form1" style="display: none">
	<input type="hidden" name="redirectUrl" value="">
	<input type="hidden" name="errorUrl" value="">
	<input type="text" id="nameInput" name="name" value="">
	<input id="passwordInput" type="password" name="password" value="" >
</form>

<script src="/public/static/js/jquery.js"></script>
<script src="/public/static/js/agree.js"></script>
<script src="/public/static/js/layui/layui.all.js"></script>
<script type="text/javascript">
    $("#login").click(function () {
        var user = $.trim($("input[name='userLoginName']").val());
        var pass = $.trim($("input[name='userPassword']").val());
        if(user==''){layer.open({title: '提示',content: '请填写账号'});return}
        if(pass==''){layer.open({title: '提示',content: '请填写密码'});return}
        var data = {
            userLoginName:user,userPassword:pass
        }
        $.post("<?php echo url('index/Sync/login'); ?>",data,function (rs) {
            if(rs.state == 0){
                layer.open({
                    title: 'error'
                    ,icon:5
                    ,content: rs.msg
                });
            }else{
                if(rs.act == 't'){
                    $("#nameInput").val(user)
                    $("#passwordInput").val(pass)
                    $("#form1").submit();
				}else{
                    location.href="<?php echo url('index/main/index'); ?>"
				}
			}
        })
    })
</script>
</body>
</html>